package com.hl.ruoyicsmshop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hl.ruoyicsmshop.mapper.GroupActivityMapper;
import com.hl.ruoyicsmshop.domain.GroupActivity;
import com.hl.ruoyicsmshop.service.IGroupActivityService;

/**
 * 拼团活动Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-09
 */
@Service
public class GroupActivityServiceImpl implements IGroupActivityService 
{
    @Autowired
    private GroupActivityMapper groupActivityMapper;

    /**
     * 查询拼团活动
     * 
     * @param gaId 拼团活动主键
     * @return 拼团活动
     */
    @Override
    public GroupActivity selectGroupActivityByGaId(Long gaId)
    {
        return groupActivityMapper.selectGroupActivityByGaId(gaId);
    }

    /**
     * 查询拼团活动列表
     * 
     * @param groupActivity 拼团活动
     * @return 拼团活动
     */
    @Override
    public List<GroupActivity> selectGroupActivityList(GroupActivity groupActivity)
    {
        return groupActivityMapper.selectGroupActivityList(groupActivity);
    }

    /**
     * 新增拼团活动
     * 
     * @param groupActivity 拼团活动
     * @return 结果
     */
    @Override
    public int insertGroupActivity(GroupActivity groupActivity)
    {
        groupActivity.setCreateTime(DateUtils.getNowDate());
        return groupActivityMapper.insertGroupActivity(groupActivity);
    }

    /**
     * 修改拼团活动
     * 
     * @param groupActivity 拼团活动
     * @return 结果
     */
    @Override
    public int updateGroupActivity(GroupActivity groupActivity)
    {
        groupActivity.setUpdateTime(DateUtils.getNowDate());
        return groupActivityMapper.updateGroupActivity(groupActivity);
    }

    /**
     * 批量删除拼团活动
     * 
     * @param gaIds 需要删除的拼团活动主键
     * @return 结果
     */
    @Override
    public int deleteGroupActivityByGaIds(Long[] gaIds)
    {
        return groupActivityMapper.deleteGroupActivityByGaIds(gaIds);
    }

    /**
     * 删除拼团活动信息
     * 
     * @param gaId 拼团活动主键
     * @return 结果
     */
    @Override
    public int deleteGroupActivityByGaId(Long gaId)
    {
        return groupActivityMapper.deleteGroupActivityByGaId(gaId);
    }
}
